﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="availability.aspx.vb" Inherits="service_driver_availability"
    MasterPageFile="~/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<h1>Availability Instructions</h1>
<ol>
<li>Please add all the times that you are available to drive throughout the semester.</li>
<li>Choose values for the day, start and end times from the drop down boxes that you are available.
<li>Click the Submit button.</li>
<li>You can add multiple times for a day.</li>
<li>Click the icon in the remove column of the Current Times table in order to remove times.</li>
</ol>
    <table class="availability-table">
        <tr>
            <th>
                <h2>
                    Current Times</h2>
            </th>
            <th>
                <h2>
                    Add New Times</h2>
            </th>
        </tr>
        <tr>
            <td>
                <asp:SqlDataSource ID="CSSADB_Availability" runat="server" ConnectionString="<%$ ConnectionStrings:serviceConnectionString %>"
                    DeleteCommand="DELETE FROM [driver_availability] WHERE [id] = @id">
                    <DeleteParameters>
                        <asp:Parameter Name="id" Type="Int32" />
                    </DeleteParameters>
                </asp:SqlDataSource>
                <asp:GridView ID="GridView1" runat="server" DataSourceID="CSSADB_Availability" Width="400px"
                    AutoGenerateColumns="False" AutoGenerateDeleteButton="False" EnableModelValidation="True"
                    DataKeyNames="id" CssClass="awesome-gridview" AllowSorting="True" >
                    <Columns>                        
                        <asp:BoundField DataField="day" HeaderText="Day" SortExpression="day" />
                        <asp:BoundField DataField="startTime" HeaderText="Start Time" DataFormatString="{0:hh:mm tt}" SortExpression="startTime" />
                        <asp:BoundField DataField="endTime" HeaderText="End Time" DataFormatString="{0:hh:mm tt}" SortExpression="endTime"  />
                        <asp:CommandField ShowDeleteButton="true" ButtonType="Image" DeleteImageUrl="images/delete.png" ControlStyle-CssClass="delete-button" HeaderText="Remove" />
                    </Columns>                    
                </asp:GridView>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            Day:
                        </td>
                        <td>
                            <asp:DropDownList ID="dayDropDownList" runat="server" Width="142px">
                                <asp:ListItem>Sunday</asp:ListItem>
                                <asp:ListItem>Monday</asp:ListItem>
                                <asp:ListItem>Tuesday</asp:ListItem>
                                <asp:ListItem>Wednesday</asp:ListItem>
                                <asp:ListItem>Thursday</asp:ListItem>
                                <asp:ListItem>Friday</asp:ListItem>
                                <asp:ListItem>Saturday</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Start:
                        </td>
                        <td>
                            <asp:DropDownList ID="startHourDropDownList" runat="server">
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                                <asp:ListItem>10</asp:ListItem>
                                <asp:ListItem>11</asp:ListItem>
                                <asp:ListItem>12</asp:ListItem>
                            </asp:DropDownList>
                            :
                            <asp:DropDownList ID="startMinuteDropDownList" runat="server">
                                <asp:ListItem>00</asp:ListItem>
                                <asp:ListItem>15</asp:ListItem>
                                <asp:ListItem>30</asp:ListItem>
                                <asp:ListItem>45</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="startAmPmDropDownList" runat="server">
                                <asp:ListItem>AM</asp:ListItem>
                                <asp:ListItem>PM</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            End:
                        </td>
                        <td>
                            <asp:DropDownList ID="endHourDropDownList" runat="server">
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                                <asp:ListItem>10</asp:ListItem>
                                <asp:ListItem>11</asp:ListItem>
                                <asp:ListItem>12</asp:ListItem>
                            </asp:DropDownList>
                            :
                            <asp:DropDownList ID="endMinuteDropDownList" runat="server">
                                <asp:ListItem>00</asp:ListItem>
                                <asp:ListItem>15</asp:ListItem>
                                <asp:ListItem>30</asp:ListItem>
                                <asp:ListItem>45</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="endAmPmDropDownList" runat="server">
                                <asp:ListItem>AM</asp:ListItem>
                                <asp:ListItem>PM</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <center>
                                <asp:Button ID="submitButton" runat="server" Style="text-align: center" Text="Submit"
                                    CssClass="awesome-button" /></center>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
